home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / utils / showmem4.lzh / SHOWMEM4.TXT < prev   
Text File  |  1991-03-15  |  4KB  |  103 lines

  1.  
  2.         *******************************************************
  3.         *                                                     *
  4.         *  ShowMem4 - The Displayer - runs as .PRG _or_ .ACC  *
  5.         *  Copyright 1988 John Eidsvoog                       *
  6.         *  Revision date: Friday, March 15, 1991              *
  7.         *                                                     *
  8.         *******************************************************
  9.  
  10.         This program is Freeware.  It may not be sold or distributed
  11.         commercially without my written permission.  You may freely
  12.         distribute it otherwise as long as the files are included in
  13.         their entirety with no modifications. 
  14.  
  15.         Included files:
  16.  
  17.           SHOWMEM4.PRG The Program/Accessory
  18.           SHOWMEM4.TXT This text file
  19.  
  20.  
  21. ShowMem4 1.4 Fixes Problem
  22. --------------------------
  23.  
  24. ShowMem4 now works correctly on TOS 1.4 and later.  Previously you may
  25. have had to run it twice in order to display a valid listing or it may
  26. have even crashed upon running the first time. 
  27.  
  28. -----------------------------------------------------------------------
  29.  
  30.  
  31. About ShowMem4
  32. --------------
  33.  
  34. ShowMem4 is specially written so that it can be run as either an
  35. accessory _or_ a program.  All you have to do is change the name (using
  36. Show Info) so that the extension (last three letters) is .ACC for an
  37. accessory, or .PRG for a program.
  38.  
  39. ShowMem4 allows you to examine the GEMDOS memory descriptor lists.  The
  40. locations of these lists in memory is not documented by Atari.  There is
  41. a search routine that should find these lists in all ROM versions
  42. (including future ones).  If this search should fail, you will be
  43. alerted that this is an unknown ROM. 
  44.  
  45. You may list the information to the screen or to a printer.  This is
  46. selected from the initial alert box.  The listing will include all
  47. allocated memory blocks, followed by all memory free blocks.  If you
  48. hold down the 'Alternate' key when you select the output device, you
  49. will also get the memory descriptor waiting list (this is my name for it
  50. as until recently its very existence was undocumented).  It is now
  51. documented as _root, or a pointer to the OS pool, although the TOS 1.4+
  52. ROMs seems to contain a pointer to a null.  When GEMDOS splits a block
  53. into two smaller blocks, it uses this list to get a new descriptor
  54. location.  When two contiguous blocks are merged, the unused block is
  55. put back in this list.  For this reason, the entries in this list may or
  56. may not contain any useful information. 
  57.  
  58. The leftmost column will show the decimal size of each block as well as
  59. a total for each type of memory blocks.
  60.  
  61. While the listing is scrolling on the screen, you may pause/continue by
  62. using the mouse button. 
  63.  
  64. ------------------------------------------------------------------------
  65.  
  66. The structure of a memory descriptor is as follows:
  67.  
  68.         long  pointer to next descriptor in list or zero (end of list)
  69.         long  starting address of the block
  70.         long  number of bytes in block
  71.         long  pointer to base page of block's owner
  72.  
  73. (This information is not documented by Atari and you should not rely on
  74. its validity as they are free to change it at any time.)
  75.  
  76.  
  77. ------------------------------------------------------------------------
  78.  
  79.  
  80. One point that should be raised about free memory, is that when GEMDOS
  81. returns the bytes available via Malloc(-1), it returns the size of the
  82. largest available block, _not_ the total available memory.  ShowMem is
  83. the only tool (to my knowldege) for the ST that will show you the true
  84. total available memory. 
  85.  
  86. When a program runs, it is given the largest available memory block to
  87. run in.  But when a program requests a memory block from GEMDOS, it is
  88. given the smallest memory block that is large enough to fill the
  89. request.  This means that smaller, fragmented block may still be useful
  90. to many applications.  It may also be confusing to someone who is using
  91. a "regular" method of determining free memory. 
  92.  
  93. You might check free memory and be told that there is 800K free, while
  94. there might be a fragmented 33K block which is unseen.  Then you might
  95. tell a program to allocate a screen buffer of 32K.  Your free memory
  96. display will still show 800K because the 32K of the 33K block will be
  97. supplied as the screen buffer.  This whole scenario can be examined by
  98. using ShowMem.
  99.  
  100.  
  101. John Eidsvoog
  102. CodeHead Software
  103.